<template>
</template>

<script>
import '../../../../static/layui/css/layui.css';
import '../../../../static/plugin/css/WSIM-ex.css';
import '../../../../static/EmojiPicker/lib/css/emoji.css';
import '../../../../static/EmojiPicker/lib/css/nanoscroller.css'

import '../../../../static/layui/layui.js';
import Util from '../../../common/util.js';

export default {
	name: 'im',
	data() {
		return {
		}
	},
	props: {
		mine:{
			type:Object,
			default:function(){
				return {};
			}
		},
		isCustomerCare:{
			type:Boolean
		},
		tokenId: {
			type: String
		},
		config: {
			type: Object,
			default: function() {
				return {};
			}
		}
	},
	created(){
		if(!layui.JMessage ||!layui.WSIM || !layui.nanoScroller ||!layui.tether || !layui.emojiConfig || !layui.emojiUtil || !layui.emojiarea || !layui.EmojiPicker){
			var self=this;			
			layui.config({
				dir:Util.projectName()+'/static/layui/',
				base:Util.projectName()+'/static/'
			}).extend({
//				JMessage: 'plugin/js/jmessage.min',
				RongIMLib: 'plugin/js/RongIMLib.min',
				RongIMEmoji: 'plugin/js/RongEmoji-2.2.7.min',
				MD5: 'plugin/js/md5',
//				Translate: 'plugin/js/baidu-translate',
				Translate: 'plugin/js/youdao-translate',
				WSIM: 'plugin/js/WSIM-rong',
				COS: 'plugin/js/cos-js-sdk-v5.min',
				FileUtil: 'plugin/js/file',
				tether:'EmojiPicker/lib/js/tether.min',
				emojiConfig:'EmojiPicker/lib/js/config',
				emojiUtil:'EmojiPicker/lib/js/util',
				emojiarea:'EmojiPicker/lib/js/jquery.emojiarea',	
				EmojiPicker:'EmojiPicker/lib/js/emoji-picker',
				mCustomScrollbar:'EmojiPicker/lib/js/jquery.mCustomScrollbar',
				mousewheel:'EmojiPicker/lib/js/jquery.mousewheel'
			});
			!layui.WSIM && layui.use(['WSIM','EmojiPicker'], function(WSIM,EmojiPicker){
				WSIM.config({
					tokenId: self.tokenId,
					mine:self.mine,
					isCustomerCare:self.isCustomerCare,
					layimOption: self.config,
					prefix:Util.projectName()				
				});
				WSIM.on('status', function(data) {

				});
			}); 
		}
	},
	mounted() {
		
	},
}
</script>

<style scoped>

</style>